<div id="articles">
    <? echo $adminMenu->manage(); ?>
    <h2><? __('Articles administration');?> (<? echo $html->link(__('new article',true), array('action'=>'add')); ?>)</h2>
    <? echo $form->create(array('action'=>'delete_articles')); ?>
    <table cellpadding="3" cellspacing="1" width="100%">
        <tr>
            <td width="10%"></td>
            <td></td>
            <td width="15%"></td>
            <td width="10%"></td>
            <td width="10%"></td>
            <td width="10%"></td>
        </tr>
        <tr class="table_head">
            <td colspan="3" class="first-top">
                <? echo $pagination->create(null,'articles'); ?>
            </td>
            <td colspan="3" class="last-top">
                <? __('Sort by'); ?>: <? echo $paginator->sort(__('Name',true),'title');?> <? echo $paginator->sort(__('Visited',true),'visited'); ?> <? echo $paginator->sort(__('Created',true),'created');?>
            </td>
        </tr>
        <tr>
            <th><? __('Action'); ?></th>
            <th><? __('Name'); ?></th>
            <th><? __('Created'); ?></th>
            <th><? __('Author'); ?></th>
            <th><? __('Visited'); ?></th>
            <th><? __('Delete'); ?> <input type="checkbox" onclick="checkAll(this,'ArticleDeleteArticlesForm')"/></th>
        </tr>
        <?
        $i = 0;
        foreach ($articles as $article):
            $class = null;
            if ($i++ % 2 == 0) {
                $class = ' class="altrow"';
            }
            ?>
        <tr<? echo $class;?>>
            <td>
                    <? echo $html->link($html->image('edit.png',array('alt'=>__('Edit', true))),array('action'=>'edit', $article['Article']['id']),array('title'=>__('Edit',true)),null,false); ?>
                    <? echo $html->link($html->image('eye.png',array('alt'=>__("Preview",true))),"/articles/".$time->format("Y/m/d",$article["Article"]["created"])."/".$article["Article"]["seo_link"],array('title'=>__('Preview',true),"target"=>"new"),null,false); ?>
                    <? echo $html->link($html->image('bin.png',array('alt'=>__('Delete', true))), array('action'=>'delete', $article['Article']['id']),array('title'=>__('Delete',true)), __('Delete item', true).' #' . $article['Article']['title'],false); ?>
            </td>
            <td>
                    <? echo $html->link($article['Article']['title'], array('action'=>'edit', $article['Article']['id'])); ?>
            </td>
            <td>
                    <? echo $time->niceShort($article['Article']['created']); ?>
            </td>
            <td>
                    <? echo $article['User']['name']; ?>
            </td>
            <td>
                    <? echo $article['Article']['visited']; ?>
            </td>
            <td  align="center">
                <input type="checkbox" name="data[ArticlesDelete][]" value="<? echo $article['Article']['id']; ?>"/>
            </td>
        </tr>
        <? endforeach; ?>
        <tr class="table_head">
            <td colspan="3" class="first-bottom">
                <? echo $pagination->create(null,'articles'); ?>
            </td>
            <td colspan="3" class="last-bottom">
                <? __('Sort by'); ?>: <? echo $paginator->sort(__('Name',true),'title');?> <? echo $paginator->sort(__('Visited',true),'visited'); ?> <? echo $paginator->sort(__('Created',true),'created');?>
            </td>
        </tr>
    </table>
    <div style="float: right; margin: 1em;"><? echo $form->submit(__('Delete',true)); ?></div>
</form>
</div>